<?php
namespace app\common\enum;

class TaskEnum{
    const CREATE = 0;
    const DOING = 1;
    const CANCEL = 2;
    const COMPLETE = 3;
    const CONFIRM = 4;


    const LIST_CREATE = 0;
    const LIST_SHARE = 1;
    const LIST_COMPLETE = 2;


    /**
     * @notes 获取禁用状态
     * @param bool $value
     * @return string|string[]
     * @author 令狐冲
     * @date 2021/7/8 19:02
     */
    public static function getTaskStatusDesc($value = true)
    {
        $data = [
            self::CREATE => '未完成',
            self::DOING => '进行中',
            self::CANCEL => '取消',
            self::COMPLETE => '完成',
            self::CONFIRM => '已确认'
        ];
        if ($value === true) {
            return $data;
        }
        return $data[$value];
    }

    public static function getTastListDesc($value = true)
    {
        $data = [
            self::LIST_CREATE => '创建',
            self::LIST_SHARE => '分享接受',
            self::LIST_COMPLETE => '完成'
        ];
        if ($value === true) {
            return $data;
        }
        return $data[$value];
    }
}

